Bug fix: ref conflict can cause tags to be temporarily removed on a replica #8788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The read replica code that compares remote refs and local refs to determine which local refs need to be deleted when synchronizing a read replica from a remote had a problem where certain patterns of ref names could cause the code to select the wrong local refs to remove. These removed refs would not be present on the replica until a future synchronization run recreated them.
The fix for this is to use the
Ref.String()
method (instead ofRef.GetPath()
) to get a unique identifier for the ref (e.g.refs/tags/t1
) and to ensure that the remote and local ref lists are both sorted by that unique identifier.